
<!--{if !$no_header}-->
<!--{template admin/header}-->
<script>
function cat_list(obj,catid){
	if($(obj).attr('data-sub-list')>0){
		if($('#tr_id_'+catid).next('.sublist').length){
			$('#id_sublist_'+catid).toggle();
		}else{
			$('#tr_id_'+catid).after('<tr id="id_sublist_'+catid+'" class="sublist"></tr>');
		}
		if($('#id_sublist_'+catid+':visible').length){
			$(obj).children('img').attr('src','images/cp/close.gif');
		}else{
			$(obj).children('img').attr('src','images/cp/open.gif');
		}
		$.get('admin.php?mod=attachcat&id='+catid,{is_ajax:1},function(r){
			$('#id_sublist_'+catid).html(r+'');
			
		},'html');
	}
}

</script>
<table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
<tr class="header">
	<td width="40%">分类名称</td>
	<td width="40%">附件数</td>
	<td width="20%">管理</td>
</tr>

<!--{else}-->

<td colspan="6">
<table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
<tbody>
<!--{/if}-->

<!--{loop $list $one}-->
<tr class="altbg1" id="tr_id_{$one['id']}">
<td width="40%">
<span id="cat_name_{$one['id']}" data-sub-list="{$one['count_sub']}" onclick="cat_list(this,'{$one['id']}');">
<!--{if $one['count_sub']}-->
<img id="img_2" class="acp_list_img" src="images/cp/open.gif">
<!--{/if}-->
{$one['name']}
</span>
</td>

<td width="40%">
	<a href="admin.php?mod=attachcat&code=get_attach_list&catid={$one['id']}">{$one['total_count_num']}</a>
	<!--{if $one['total_count_num']}-->
	<a href="admin.php?mod=attachcat&code=get_attach_list&catid={$one['id']}">查看</a>
	<!--{/if}-->
</td>

<td width="20%">
	<a href="admin.php?mod=attachcat&amp;code=delete&amp;catid={$one['id']}">删除</a>
	<a href="admin.php?mod=attachcat&amp;code=modify&amp;catid={$one['id']}">编辑</a>
</td>
</tr>
<!--{/loop}-->

<!--{if !$no_header}-->
<!--无分类附件查看-->
<tr class="altbg1" id="tr_id_0">
	<td width="40%"> 
		<span id="cat_name_1" data-sub-list="0">无分类附件</span>
	</td> 
	<td width="40%"> 
		<a href="admin.php?mod=attachcat&amp;code=get_attach_list&amp;catid=0">查看</a>  
	</td> 
	<td width="20%">
	</td>
</tr>
</table>

<a href="admin.php?mod=attachcat&code=add">添加分类</a>

<!--{else}-->
</tbody>
</table>
</td>
<!--{eval exit();}-->
<!--{/if}-->




